<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<link rel="stylesheet" type="text/css" href="style/global.css" />
<link rel="stylesheet" type="text/css" href="style/admin.css" />
<script src="js/xheditor/jquery/jquery-1.4.4.min.js"></script>
<title>问卷管理__栏目管理</title>
</head>
<body>
	<div id="wrap">
    	<div id="public_head"></div>
        <div class="m_search qq_bh">
        	<span class="red"><b>从系统题库选择：</b></span>
        </div>
        <div class="m_revise" id="revise">
        <form action="" method='post'>
        <?php 
        	foreach ($tit as $k=>$val){
        ?>
        		<div class="field">
                <h2 class="itemTitle" id="fold"><a href="javascript:void(0)" class="dsphead" onclick="dsp(this)"><span class="dspchar">-</span>&nbsp;<?php echo $cate[$k]?></a></h2>
                <div class="itemText" style='display:block'>
    	<?php 
    			foreach ($val as $v){
		?>
					<div class="List-Item" to="opt_<?php echo $v['Q_ID']?>"><input id="" type="checkbox" value="<?php echo $v['Q_ID']?>" <?php if(in_array($v['Q_ID'], $checked)){echo ' checked ';}?> name="alltit[]">&nbsp;<span style='cursor:pointer'><?php echo $v['TITLE']?></span></div>
					<div style="display:none;color:green;position:absolute;background:#81D9FF;padding:4px" id='opt_<?php echo $v['Q_ID']?>'>
						<?php 
							switch ($v['QTYPE']) {
								case 1:echo '单选题:&nbsp;';break;
								case 2:echo '多选题:&nbsp;';break;
								default:echo '填空题;(<font color=red>需要用户自己输入</font>)&nbsp;';break;
							}
							$i = 1;
							foreach ($opt as $vv){
								if($vv['QID']==$v['Q_ID']){
									echo $i++.'、'.$vv['ONAME'];
									if($vv['INPUT']==1){
										echo '&nbsp;(<font color=red>允许用户输入</font>)';
									}
									echo ';&nbsp;';
								}
							}
						?>
					</div>
		<?php 
				}
				echo '</div></div>';
			}
		?>
            <div class="field">
            	<div class="itemText"><input class="btn_define" name="add_tit" type="submit" value="" /> <input class="btn_gray" name="" type="button" value="返回" onclick="location.href='/index.php?c=quesnr&a=index'"/></div>
            </div>
        </div>
    </div>
    </form>
    </div>
<script>
$('div.List-Item').hover(
	function (){
		var a = $(this).attr('to');
		$('#'+a).css({'left':$(this).children('span').offset().left+$(this).children('span').width()+5+'px','top':$(this).offset().top+10+'px'})
		$('#'+a).fadeIn();
	},
	function (){
		var a = $(this).attr('to');
		$('#'+a).fadeOut();
	}
)
//function initHeight(){
//	var h = $(document).height();
//	$('#revise').height(h-55);
//	
//}
//initHeight();
//
//$(window).resize(function(){
//  initHeight();
//});
</script>
<script type="text/javascript"><!--
function dsp(loc){
if(document.getElementById){
foc=loc.firstChild.innerHTML?
loc.firstChild:
loc.firstChild.nextSibling;/*使foc为当前点的下一个子元素的innerHTML也就是那个带+符号的<span>的innerHTML*/
foc.innerHTML=(foc.innerHTML=='+')?'-':'+';/*判断<span>里的内容是-还是+号,是+就变-,是-就变+*/
foc=loc.parentNode.nextSibling.style?
loc.parentNode.nextSibling:
loc.parentNode.nextSibling.nextSibling;/*将判断位置移动到<a>的父兄(就是h1后面的隐藏div)*/
foc.style.display=foc.style.display=='block'?'none':'block';}/*判断div的display是none还是block,设置为相反的值*/}

if(!document.getElementById)
document.write('<style type="text/css"><!--\n'+
'.dspcont{display:block;}\n'+
'//--></style>');
//--></script>
</body>
</html>
<script src="/js/add_public_head.js" type="text/javascript"></script>